<template>
  <div>
  
<el-card shadow="always" class="box-card">
      <div class="tableTitle"><span>基本信息</span></div>
      <div class="devTitle"><span>{{infoDetail.taskNum}}</span></div>
      <div>
        <div class="tableStyle">
          <div class="labelS">任务编号</div>
          <div class="contentS">{{infoDetail.taskNum}}</div>
          <div class="labelS">计划开始时间</div>
          <div class="contentS">{{infoDetail.planBeginTime}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">计划编号</div>
          <div class="contentS">{{infoDetail.planName}}</div>
          <div class="labelS">计划名称</div>
          <div class="contentS">{{infoDetail.planName}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">设备编号</div>
          <div class="contentS">{{infoDetail.planName}}</div>
          <div class="labelS">计划部门</div>
          <div class="contentS">{{infoDetail.deviceId}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">状态</div>
          <div class="contentS"><span class="nocomplate complate">{{infoDetail.statusName}}</span></div>
        </div>
        <div class="tableStyle">
          <div class="labelS">检修人</div>
          <div class="contentS">{{infoDetail.handlerId}}</div>
        </div>
        <div class="tableStyle">
          <div class="labelS">验收人</div>
          <div class="contentS">{{infoDetail.acceptorId}}</div>
        </div>
      </div>
    </el-card>
    <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">相关附件</span>
      </div>
    </el-card>
    <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">检修信息</span>
      </div>
      <el-table :data="tableData2" border style="width: 100%">
           <el-table-column
         label="序号"
      type="index"
      width="50">
    </el-table-column>
        <el-table-column prop="number" label="检修项名称" >
        </el-table-column>
        <el-table-column prop="project" label="技术要求"> </el-table-column>
        <el-table-column prop="time" label="安全要求"> </el-table-column>
         <el-table-column prop="project" label="质量要求"> </el-table-column>
        <el-table-column prop="time" label="说明事项"> </el-table-column>
        <el-table-column prop="time" label="检修耗时(h)"> </el-table-column>
        <el-table-column prop="time" label="检修说明"> </el-table-column>
      </el-table>
    </el-card>
    <el-card shadow="always" class="box-card">
      <div class="headerStyle"><span class="tableTitle">关联异常项</span>
      </div>
      <el-table :data="tableData2" border style="width: 100%">
           <el-table-column
         label="序号"
      type="index"
      width="50">
    </el-table-column>
        <el-table-column prop="number" label="编号" >
        </el-table-column>
        <el-table-column prop="project" label="异常项目"> </el-table-column>
        <el-table-column prop="time" label="点检标准"> </el-table-column>
        <el-table-column prop="person" label="描述"  width="60"> </el-table-column>
        <el-table-column prop="recordpic" label="备注"  > </el-table-column>
        <el-table-column prop="intr" label="时间"  width="100"> </el-table-column>
        <el-table-column prop="kinds" label="是否消除"> </el-table-column>
    
      </el-table>
    </el-card>
     
  </div>
</template>
<script>
import {getObj,statusList} from "@/api/ems/repair/task";
export default {
  data() {
    return {
      tableData: [],
      tableData2: [],
      id:"",
      infoDetail:{},
      statusList:[]
    };
  },
  mounted(){
    this.id = this.$route.query.id;
    this.getObjList();
    this.getStatus();
  },
  methods:{
    getObjList(){
      getObj(this.id).then((res)=>{
        this.infoDetail = res.data.data
      })
    },
    getStatus(){
      statusList().then((res)=>{
        this.statusList = res.data.data;
        let obj = this.statusList.filter((val)=>val.value==this.infoDetail.status);
        
        this.$set(this.infoDetail,'statusName',obj[0].label)
      })
    }
  }
};
</script>
<style lang="scss" scoped>
@import "@/styles/color.scss";
.headerStyle{
   margin-bottom: 20px;
}
.tableTitle {
  color: #333;
  font-size: 16px;
  font-weight: bold;
 margin-bottom: 20px;
 
}
.smallTitle{
  color: rgba(153, 153, 153, 100);
font-size: 12px;
margin-left: 10px;
}
.devTitle {
  color: #262626;
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 20px;
}
.box-card {
  margin-bottom:10px;
  .el-card__body {
    padding-top: 10px;
  }
  .labelS {
    //display: inline-block;
    flex:0 0 150px;
    //height: 40px;
    // margin-right: 10px;
    text-align: left;
    color: #606266;
    padding: 10px;
    border: 1px solid rgba(236, 240, 244, 100);
    margin-bottom: -1px;
  }
  .contentS {
    border: 1px solid rgba(236, 240, 244, 100);
    // height: 40px;
    color: #606266;
    width: 100%;
    margin-left: -1px;
    margin-bottom: -1px;
    padding: 10px;
    // margin: 10px 0;
    // width: calc(100% - 120px);
    // display: inline-block;
  }
  .tableStyle {
    display: flex;
  }
  .number{
      font-weight: bold;
      margin-top: 5px;
      font-size: 16px;
  }
  .nocomplate{
      color: white;
    //   background-color: #E83672;
      padding: 3px 5px;
      border-radius: 3px;
      font-size: 12px;
  }
  .complate{
     background-color: #57C4B0;
  }
}

</style>
